
<template>
  <div>
      <div class="bigbox">
      <div class="content" v-for="(v,i) in arr" :key="i">
        <img :src="v.url"/>
        <span class="span1">入门级耳机</span>
        <span class="span1">Beats</span>
        <div class="name">{{v.name}}</div>
        <span>{{v.price}}</span>
        <span class="span2">二手 2.4折</span>
      </div>
    </div>
  </div>
</template>

<script>
import getlink from "../api/getapi"
export default {
    data () {
        return {
            arr:[]      
        }
    },
    mounted () {
        getlink("/data/list").then((ok)=>{
            this.arr=ok.data.quan;
        })
    },
};
</script>

<style scoped>
    .bigbox{
        width: 90%;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        margin-top: 0.2rem;
        flex-wrap: wrap;
    }
    img{
        width: 1.65rem;
        height: 1.65rem;
    }
    .content{
        width: 47%;
        margin-bottom: 0.2rem;
    }
    .span1{
        display: inline-block;
        height: 0.25rem;
        font-size: 0.13rem;
        background-color: #F4F7F4;
        line-height: 0.25rem;
        padding-left: 0.1rem;
        padding-right: 0.1rem;
        border-radius: 0.2rem;
        color: #497749;
    }
    .span2{
        display: inline-block;
        height: 0.2rem;
        font-size: 0.13rem;
        line-height: 0.20rem;
        padding-left: 0.05rem;
        padding-right: 0.05rem;
        color: #C75943;
        margin-left: 0.1rem;
        border: 1px solid #D58372;
        border-radius: 0.05rem;
    }
    .name{
        margin: 0.1rem 0; 
        overflow: hidden;
        display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
    }
</style>